<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>jq</title>
	<script src="jquery.js"></script>
	
</head>
<style>
	
</style>


<body>
	<img src="a.jpg" alt="">
	
</body>
<script>

	

	$('img').click(function(){
		$('img').attr({'src':'b.jpg'});
		//alert(this.src);//取出图片的所有路径
		//alert($(this).attr('src'));//取出图片的名字
	});

</script>
</html>